Avoid errors when flyspell-generic-check-word-predicate is a lambda.
authorHong Xu <hong@topbug.net>
Thu, 16 Feb 2017 21:28:56 +0000 (13:28 -0800)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 18 Feb 2017 02:50:46 +0000 (21:50 -0500)
* flyspell.el (flyspell-auto-correct-word, flyspell-word): Apply
functionp instead of fboundp on
flyspell-generic-check-word-predicate (Bug#25765).

lisp/textmodes/flyspell.el

index 3a32b75534909f4c526adb7100d96d17b365904c..0edf9b1a47e3b8e741fb20ee199498d358aba03f 100644 (file)
@@ -1111,8 +1111,8 @@ misspelling and skips redundant spell-checking step."
            (flyspell-word (flyspell-get-word following))
            start end poss word ispell-filter)
       (if (or (eq flyspell-word nil)
-             (and (fboundp flyspell-generic-check-word-predicate)
-                  (not (funcall flyspell-generic-check-word-predicate))))
+              (and (functionp flyspell-generic-check-word-predicate)
+                   (not (funcall flyspell-generic-check-word-predicate))))
          t
        (progn
          ;; destructure return flyspell-word info list.
@@ -1918,7 +1918,7 @@ This command proposes various successive corrections for the current word."
   ;; invoke the original binding of M-TAB, if that was recorded.
   (if (and (local-variable-p 'flyspell--prev-meta-tab-binding)
            (commandp flyspell--prev-meta-tab-binding t)
-           (fboundp flyspell-generic-check-word-predicate)
+           (functionp flyspell-generic-check-word-predicate)
            (not (funcall flyspell-generic-check-word-predicate))
            (equal (where-is-internal 'flyspell-auto-correct-word nil t)
                   [?\M-\t]))